<?php 
$this->assign('button_save_template','<a href="javascript:void(0)" class="btn btn-sm btn-info" onclick="ShowModel();"><i class="fa fa-fw fa-plus"></i> NEW TEMPLATE</a>');
$this->Html->css(array('font', 'app.v2'), array('inline' => false));
$this->Html->script(array('app.v2', 'fuelux/fuelux', 'underscore-min', 'datatables/jquery.dataTables.min', 'script', 'jquery-ui-1.10.3.custom.min', 'jquery.ui.touch-punch.min'), array('inline' => false));
?>
<section id="content">
	<section class="main padder">
		<div id="result" style="padding-top: 20px; display: none"></div>
		<div class="clearfix">
			<h4><i class="fa fa-th-list"></i> <?php echo $current_group['Group']['name'];?></h4>
		</div>
		<div class="row">
		
			<?php 
						
				foreach($aco_records as $aco_record){
				
					$childrens = $aco->children($aco_record['Aco']['id'], true);
					
					
					if($childrens){
						echo '<div class="col-lg-6 portlet ui-sortable">';
						echo '<section class="panel portlet-item">';
						echo '<header class="panel-heading bg bg-inverse">'.$aco_record['Aco']['alias'].'</header>';
						echo '<ul class="list-group">';
						
						foreach($childrens as $children){
					
							$aco_alias = $children['Aco']['alias'];
							
							if($acl->check($aro_alias, $aco_alias)){
								$msg = "<a href='' onclick=SecurityAccess({$children['Aco']['id']},'deny','groups',{$current_group['Group']['id']})><i class='fa fa-check fa-lg text-success'></i></a>";
							} else {
								$msg = "<a href='' onclick=SecurityAccess({$children['Aco']['id']},'allow','groups',{$current_group['Group']['id']})><i class='fa fa-times fa-lg text-danger'></i></a>";
							}
							
							echo "<li class='list-group-item'>
									<div class='btn-group pull-right m-t-n-mini m-r-n-mini'>
										{$msg}
									</div>	
									<a href='javascript:void(0)' class='h5'>{$children['Aco']['alias']}</a> 
								</li>";
						}
						
						echo '</ul>';
						echo '</section>';
						echo '</div>';
					}
					
					
				}
			?>
		</div>
	</section>
</section>